package com.zhenfan.pattern.register;

/**
 * 枚举式注册单例
 * 获取单例相当于饿汉式
 * 怪物枚举
 *
 * @author wangmh
 * @create 2018-10-30 16:08
 **/
public enum MonsterEnum {

    /**
     * 史莱姆
     */
    SLEM("史莱姆", 10, 10, 1, 1),

    /**
     * 骷髅
     */
    SKULL("骷髅", 20, 10, 2, 2);

    /**
     * 名称
     */
    private String name;

    /**
     * 血量
     */
    private int HP;

    /**
     * 魔力
     */
    private int MP;

    /**
     * 攻击力
     */
    private int ATT;

    /**
     * 防御力
     */
    private int DEF;

    MonsterEnum(String name, int HP, int MP, int ATT, int DEF) {
        this.name = name;
        this.HP = HP;
        this.MP = MP;
        this.ATT = ATT;
        this.DEF = DEF;
    }

    public String getName() {
        return name;
    }

    public int getHP() {
        return HP;
    }

    public int getMP() {
        return MP;
    }

    public int getATT() {
        return ATT;
    }

    public int getDEF() {
        return DEF;
    }

    @Override
    public String toString() {
        return getClass().getName() + "@" + Integer.toHexString(hashCode());
    }
}
